<template>
  <div>
    <h1>如花</h1>
    <h3>{{ $store.state.user.username }}</h3>
    <h3>{{ $store.state.user.age }}</h3>
    <h3>{{ $store.getters['user/pingfang'] }}</h3>
    <button @click="$store.commit('user/updateAge', 2)">让年龄加2</button>
    <button @click="$store.dispatch('user/asdasd3s', 1)">
      让年龄两秒后加1
    </button>
    <hr />
    <hello></hello>
  </div>
</template>

<script>
import hello from './hello.vue'
export default {
  components: { hello },
  name: 'MyApp'
}
</script>

<style lang="less" scoped></style>
